<?php  # Script -- broadcast.php

/* Author @ Huoty
 *   Date @ 2015-11-17 10:38:02
 *  Brief @ 
 */

$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_connect($sock, "255.255.255.255", 11109);
socket_set_option($sock, SOL_SOCKET, SO_BROADCAST, 1);
$buf = "Hello World!";
socket_write($sock,$buf,strlen($buf));
socket_close($sock);

?>
